

#include "../include/rdma_transporter.h"

struct message{
	uint32_t msg_size;
	char *buf;

};


void init(rdma_fd *handler){
    uint16_t port = 9001;
    int sock = server_exchange(port);
    handler->fd = sock;
    context_info *ib_info = (context_info *)malloc(sizeof(context_info));
    open_device_and_alloc_pd(ib_info);
    get_context_info(handler, ib_info);
    build_rdma_connection(handler);
}

int main(){

    rdma_fd *handler = (rdma_fd *)malloc(sizeof(rdma_fd));
    init(handler);
    int count = 0;
    for(;;){
        read_msg(handler); 
        count++;
        if(count == 10000){
            printf("count: %d\n", count);
        }
    }
    
    return 0;

}
